﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sizeedit.aspx.cs" Inherits="StoreWeb.system.basis.sizeedit" %>


<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="../../css/jquery.autocomplete.css" rel="stylesheet" />
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>编辑商品信息</title>
</head>
<body>
    <div class="pd-20">
        <form runat="server" method="post" class="form form-horizontal" id="formmemberadd">
            <%-- <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>分类名称：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="" id="name" name="name" runat="server" datatype="*4-16" nullmsg="分类名称不能为空">
                </div>
                 <div class="col-4"> </div>
            </div>--%>
            <%--<div class="row cl">
                <label class="form-label col-2">尺寸类型：</label>
                <div class="formControls col-6">
                    <asp:DropDownList ID="ddlisttype" CssClass="select" Style="" runat="server">
                        <asp:ListItem Value="1">正常尺寸</asp:ListItem>
                        <asp:ListItem Value="2">特体尺寸</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div class="col-4"></div>
            </div>--%>
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>尺寸编码：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="请填写尺寸编码" id="code" name="code" runat="server" datatype="*" nullmsg="尺寸编码不能为空">
                </div>
                <div class="col-4"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2"><span class="c-red">*</span>尺寸属性：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="请输入尺寸属性" id="name" name="name" runat="server" datatype="*" nullmsg="尺寸属性不能为空">
                </div>
                <div class="col-4"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">参考尺寸值：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="请输入参考尺寸值" id="value" name="value" runat="server">
                </div>
                <div class="col-4"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">最小偏差量：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="请输入最小偏差量" id="minpx" name="minpx" runat="server">
                </div>
                <div class="col-4"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">最大偏差量：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="请输入最大偏差量" id="maxpx" name="maxpx" runat="server">
                </div>
                <div class="col-4"></div>
            </div>
            <div id="isgroup" style="display: none;">
                <div class="row cl">
                    <label class="form-label col-2"><span class="c-red">*</span>所属分组：</label>
                    <div class="formControls col-6">
                        <input type="text" class="input-text" value="" placeholder="请输入分组信息" id="group" name="group" runat="server">
                    </div>
                    <div class="col-4"></div>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">备注：</label>
                <div class="formControls col-6">
                    <input type="text" class="input-text" value="" placeholder="可选" id="note" name="note" runat="server">
                </div>
                <div class="col-4"></div>
            </div>
            <%--<div class="row cl">
                <label class="form-label col-2">同步类型：</label>
                <div class="formControls col-6">
                    <asp:RadioButtonList ID="classlist" runat="server" RepeatColumns="3">
                    </asp:RadioButtonList>
                </div> <div class="col-4"> </div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">同步属性：</label>
                <div class="formControls col-6">
                    <asp:RadioButtonList ID="typelist" runat="server" RepeatColumns="3">
                        <asp:ListItem Value="bSale" Selected="True">销售</asp:ListItem>
                        <asp:ListItem Value="bPurchase">外购</asp:ListItem>
                        <asp:ListItem Value="bComsume">生产耗用</asp:ListItem>
                        <asp:ListItem Value="bSelf">自制</asp:ListItem>
                        <asp:ListItem Value="bProducing">在制</asp:ListItem>
                        <asp:ListItem Value="bService">劳务费用</asp:ListItem>
                    </asp:RadioButtonList>
                </div> <div class="col-4"> </div>
            </div>--%>
            <div class="row cl">
                <div class="col-10 col-offset-2">
                    <asp:HiddenField ID="hidid" runat="server" />
                    <asp:HiddenField ID="cinvstd" runat="server" />
                    <asp:Button ID="btnok" runat="server" CssClass="btn btn-success radius" Text="&nbsp;&nbsp;确定&nbsp;&nbsp;" />
                    <button onclick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
                </div>
            </div>
        </form>
    </div>
    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="../../js/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/Validform/5.3.2/Validform.min.js"></script>
    <script type="text/javascript" src="../../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
    <script>
        $(function () {
            $.ajax({
                type: "POST",
                contentType: "application/json",
                url: "../../ajax/size.aspx?action=getparent",
                dataType: "json",
                success: function (datas) {
                    $("#code").autocomplete(datas, {
                        matchContains: true,
                        formatItem: function (row, i, max) {
                            if (row.parentcode != undefined) {
                                return "<table width='400px'><tr><td align='left'>" + row.parentcode + "</td></tr></table>";
                            } else {
                                return "<table width='400px'><tr><td align='left'>没有找到相关数据！</td></tr></table>";
                            }
                        },
                        formatMatch: function (row, i, max) {
                            return row.parentcode ;
                        }
                    }).result(function (event, data, formatted) {
                        $("#code").val(data.parentcode);
                    });
                }
            });
            $("#ddlisttype").change(function () {
                if ($(this).val() == "1" || ($(this).val() == "2" && $("#parentlist").val() == "") || ($(this).val() == "1" && $("#parentlist").val() != "")) {
                    $("#isgroup").hide("slow");
                } else {
                    $("#isgroup").show("slow");
                }
            });

            $("#formmemberadd").Validform({
                tiptype: 2,
                btnSubmit: "#btnok",
                //callback: function (form) {
                //    form[0].submit();
                //    var index = parent.layer.getFrameIndex(window.name);
                //    parent.$('.btn-refresh').click();
                //    parent.layer.close(index);
                //}
                //,
                beforeSubmit: function (curform) {
                    $.post("../../ajax/size.aspx", { id: $("#hidid").val(), type:1, code: $("#code").val(), name: $("#name").val(), value: $("#value").val(), minpx: $("#minpx").val(), maxpx: $("#maxpx").val(), group: $("#group").val(), note: $("#note").val(), cinvstd: $("#cinvstd").val() },
                    function (data) {
                        if (data == 1) {
                            parent.layer.alert("添加成功", function (index) {
                                parent.layer.close(index);
                                layer_close();
                            });
                        } else if (data == 2) {
                            parent.layer.alert("修改成功", function (index) {
                                parent.layer.close(index);
                                layer_close();
                            });
                        } else {
                            parent.layer.msg("操作失败");
                        }
                    });
                    return false;
                }
            });
        });
    </script>
</body>
</html>
